package com.basic.modules.nykf.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.basic.common.utils.R;
import com.basic.modules.nykf.entity.CustomizeQueryEntity;
import com.basic.modules.nykf.service.CustomizeQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("new/ykf/customizeQuery")
public class CustomizeQueryController {

    @Autowired
    CustomizeQueryService customizeQueryService;

    @GetMapping("/getCustomizeQueryField")
    public R getConsultationRecordsEntity(@RequestParam String moduleName) {
        QueryWrapper<CustomizeQueryEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("module_name", moduleName);
        List<CustomizeQueryEntity> list = customizeQueryService.list(queryWrapper);
        return R.ok(list);
    }
}